package top.lishuoboy.hutool.system;

import cn.hutool.core.lang.Console;
import cn.hutool.system.SystemUtil;

import java.util.Map;
import java.util.Properties;

public class SystemUtilTest {
    public static void main(String[] args) {
//        概述
//        此工具是针对System.getProperty(name)的封装，通过此工具，可以获取如下信息：

        Console.log("=====Java Virtual Machine Specification信息=====");
        Console.log(SystemUtil.getJvmSpecInfo());

        Console.log("=====Java Virtual Machine Implementation信息=====");
        Console.log(SystemUtil.getJvmInfo());

        Console.log("=====Java Specification信息=====");
        Console.log(SystemUtil.getJavaSpecInfo());

        Console.log("=====Java Implementation信息=====");
        Console.log(SystemUtil.getJavaInfo());

        Console.log("=====Java运行时信息=====");
        Console.log(SystemUtil.getJavaRuntimeInfo());

        Console.log("=====系统信息=====");
        Console.log(SystemUtil.getOsInfo());

        Console.log("=====用户信息=====");
        Console.log(SystemUtil.getUserInfo());

        Console.log("=====当前主机网络地址信息=====");
        Console.log(SystemUtil.getHostInfo());

        Console.log("=====运行时信息，包括内存总大小、已用大小、可用大小等=====");
        Console.log(SystemUtil.getRuntimeInfo());

        Console.log("=====System.getProperties()=====");
        Properties properties = System.getProperties();
        for (Map.Entry entry : properties.entrySet()) {
            Console.log("{}=={}",entry.getKey(),entry.getValue());
        }

        Console.log("=====System.getenv()=====");
        Map<String, String> getenv = System.getenv();
        for (Map.Entry entry : getenv.entrySet()) {
            Console.log("{}=={}",entry.getKey(),entry.getValue());
        }


    }
}
